/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/*
 * Copyright (c) 2014, Joyent, Inc.
 */

@import "__vms-list";

#sshkey-view {
  .modal-footer { margin-top: 0; }
  textarea {
    .box-sizing(border-box);
    font-family: @font-family-monospace;
    font-size: 12px;
    height: 170px;
    padding: 10px;
    border: none;
    background: #f3f3f3;
    width: 100%;
  }
}

#sshkey-create {
  input[name=name] {
    width: 100%;
    font-family: @font-family-monospace;
    font-size: 12px;
    padding: 5px;
    .box-sizing(border-box);
  }
  textarea {
    margin-top: 2px;
    .box-sizing(border-box);
    width: 100%;
    height: 120px;
    margin-bottom: 0;
    font-family: @font-family-monospace;
    font-size: 10px;
    white-space: pre;
  }
}



#page-user {
  h3 { margin-top: 10px; margin-bottom: 20px; }
  .loading {
    position: fixed;
    top: 25%;
    left: 50%;
    width: 600px;
    margin-left: -300px;
    text-align: left;
    font-size: 18px;
  }
  .user-menu a { font-size: 12px; }
  .user-icon {
    width: 65px;
    height: 65px;
    background-color: #FFF;
    background-position: middle;
    background-repeat: no-repeat;

    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
  }
  .user-info {
    height: 65px;
    vertical-align: middle;
    display: inline-block;
    padding-top: 10px;
    .cn {
      display: inline-block;
    }
    .uuid {
      font-size: 10px;
      color: @gray-light;
      margin-top: 3px;
    }
  }
  .user-groups {
    display: inline-block;
    vertical-align: bottom;
    margin-left: 10px;
    margin-bottom: 5px;
    .group {
      font-size: 8px;
      padding: 4px 6px;
      text-transform: uppercase;
      font-weight: 400;
      letter-spacing: 1px;
      background: #333;
      color: #fff;
    }
    .group.readers {
      background: #888;
    }
    .group.operators {
      background: @brand-danger;
    }
  }


  .vms-list { .__vms-list; }
  .vms-filter { .__vms-filter; }

  .user-profile {
    th { width: 280px;}
    .provisioning.approved { color: @state-success-text; }
    .provisioning.disabled { color: @state-danger-text; }
    .registered-developer.yes { color: @state-success-text; }
    .registered-developer.no { color: @state-danger-text; }
    .triton-cns-enabled.yes { color: @state-success-text; }
    .triton-cns-enabled.no { color: @state-danger-text; }
    .portal-2fa.enabled { color: @state-success-text; }
    .portal-2fa.disabled { color: @state-danger-text; }

    .toggle-2fa { float: right; margin-right: 10px;}
  }

  .limits-list {
    ul li {
      .datacenter {
        .widget-content;
        .widget-header;
        .actions {
          float: right;
          a.edit { color: @gray; }
          a.del { color: @brand-danger; margin-left: 10px; }
        }
      }
      .limit {
        .widget-content;
        .image { color: @gray-light; display: inline-block; width: 200px; font-weight: bold; }
        .value { display: inline-block; width: 200px; }
      }
    }
  }

  .items::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
  }
  .items::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0,0,0,.5);
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
  }

  .ssh-keys {
    .items {
    }
    .item {
      .widget-content;

      .make-row(0);
      .name {
        .make-xs-column(3, 0);
      }
      .fingerprint {
        .make-xs-column(8, 0);
        font-family: @font-family-monospace;
        font-size: 11px;
        line-height: 20px;
        color: @gray-light;
      }
      .actions {
        .make-xs-column(1, 0);
        text-align: right;
        .remove { font-size: 12px; text-decoration: none; color: @brand-danger; padding: 8px; }
      }
    }

  }

  .networks-list {
    #page-networks > .networks-list;
    // li .name { width: 180px; }
    // li .vlan { width: 60px; }
    // li .provision-ip-range { display: none;}
    // li .gateway { width: 100px; }
  }

  .network-pools-list {
    #page-networks > .network-pools-list;
  }

  .user-subusers {
    .subuser {
      .make-row();
      margin-bottom: 10px;
    }
    .subuser-icon-container {
      .make-xs-column(1);
      .subuser-icon {
        width: 48px;
        height: 48px;
        background-color: #FFF;
        background-position: middle;
        background-repeat: no-repeat;

        border-radius: 50%;
        vertical-align: middle;
        margin-right: 20px;
      }
    }
    .subuser-email {
      .make-xs-column(3);
    }
    .subuser-roles {
      .make-xs-column(3);
      .roles-header {
        font-size: 10px;
        text-transform: uppercase;
        margin-bottom: 5px;
        color: @gray-light;
      }
      .role {
        padding: 4px 6px;
        background: @state-info-bg;
        border: 1px solid @state-info-border;
        font-size: 10px;
        display: inline-block;
      }
    }
    .subuser-details {
      .make-xs-column(3);
      .alias {
        font-weight: bold;
      }
    }
    .subuser-actions {
      .btn-link {
        .pull-right;
      }
      .btn-danger {
        color: @brand-danger;
      }
    }
  }

  .user-policies {
    .policy {
      margin-bottom: 10px;
      .remove-policy { padding: 0 8px; }
      .edit-policy { padding: 0 8px; }
      .name { font-weight: bold; }
      .description { }
      .rule {
        .rule-text {
          font-size: 11px;
          font-family: @font-family-monospace;
          background: #eee;
        }
      }
    }
  }

  .user-roles {
    .roles-list {
      .role {
        .make-row();
        margin-bottom: 10px;
      }
      .role-info {
        .make-xs-column(4);
        .role-name { font-weight: bold; }
        .role-uuid { font-family: @font-family-monospace; font-size: 10px; color: @gray-light; }
      }
      .role-actions {
        text-align: right;
        .make-xs-column(2);
      }
      .role-members, .role-policies {
        .make-xs-column(3);
        h6 { margin:0; text-transform: uppercase; font-size: 10px; }
      }
      .role-members {
        .member {
          cursor: pointer;
          display: inline-block;
          margin-right: 5px;
          background: @state-info-bg;
          border-bottom: 1px solid darken(@state-info-bg, 5%);
          font-size: 11px;
          padding: 2px 5px;
          margin-top: 3px;
        }
      }
      .role-policies {
        .no-policies { color: @gray-light; }
        .policy {
          display: inline-block;
          .policy-name {
            cursor: help;
            display: inline-block;
            margin-right: 5px;
            background: @state-info-bg;
            border-bottom: 1px solid darken(@state-info-bg, 5%);
            font-size: 11px;
            padding: 2px 5px;
            margin-top: 3px;
          }
          .policy-rules {
            margin-top: 4px;
            position: absolute;
            background: #888;
            color: #fff;
            padding: 4px 8px;
            font-size: 10px;
            font-family: @font-family-monospace;
            i.fa {
              position: absolute;
              color: #888;
              margin-top: -10px;
            }
          }
        }
      }
    }




    .user-roles-form {
      .loading-role { color: @gray-light;}
      .form { margin-top: 20px; }
      .role-policies,
      .role-members { }
      .role-policy-select {
        .make-row(0);
        padding: 10px;
        background: #efefef;
      }

      .policy {
        &.empty { background: @gray-lighter; }
        .make-row(0);
        padding: 10px;
        font-family: @font-family-monospace;
        background: @state-info-bg;
        border-bottom: 1px solid darken(@state-info-bg, 5%);
        font-size: 11px;

        .policy-actions {
         .make-xs-column(1, 0);
          text-align: right;
          button.btn-link { padding: 0; line-height: 0; font-size: 10px;}
        }
        .policy-name {
          font-weight: bold;
          .make-xs-column(4, 0);
        }
        .policy-rules {
           .make-xs-column(7, 0);
        }
      }

      .member {
        &.empty { background: @gray-lighter; }
        .make-row(0);
        .member-name {
          font-weight: bold;
           .make-xs-column(11, 0);
        }
        .member-actions {
          .make-xs-column(1, 0);
          text-align: right;
          button.btn-link { padding: 0; line-height: 0; font-size: 10px;}
        }
        padding: 10px;
        font-family: @font-family-monospace;
        font-size: 11px;
        background: @state-info-bg;
        border-bottom: 1px solid darken(@state-info-bg, 5%);
      }

    }
  }
  .attempts { display: inline; }
}
